package speedometerObs;

import java.util.Observable;

public class Speedometer extends Observable {
    private int currentSpeed;
 
    public Speedometer() {
        currentSpeed = 0;
    }
 
    public void setCurrentSpeed(int speed) {
        currentSpeed = speed;
 
        // Tell all observers so they know speed has changed...
        setChanged();
        notifyObservers();
    }
 
    public int getCurrentSpeed() {
        return currentSpeed;
    }
}



